package Tydzien9;

import java.applet.Applet;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public class SimpleRepaintHandler implements ItemListener {
	
	@Override
	public void itemStateChanged(ItemEvent e) {
		Component comp = ((Component)e.getSource());
		while(comp != null && !(comp.getParent() instanceof Applet))
		{
			comp = comp.getParent();
		}
		if(comp != null) comp.getParent().repaint();
	}
}
